﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
									namespace="VictorBlaga.DocumentManagement.Core.Models"
									assembly="VictorBlaga.DocumentManagement.Core">
  <class name="User" table="Users" dynamic-update="true">
    <cache usage="read-write"/>
    <id name="ID" column="UserID" type="Int32" unsaved-value="0">
      <generator class="native"/>
    </id>
    <property name="Username" length="50" not-null="true" unique="true"/>
    <property name="Firstname" length="50"/>
    <property name="Lastname" length="50"/>
    <property name="Email" length="100"/>
    <property name="UserLevel"/>
    <property name="PasswordHash"/>
    <property name="PasswordSalt"/>
    <many-to-one name="Workshop" column="WorkshopID" class="Workshop" not-null="false"/>    
    <one-to-one name="ManagesWorkshop" class="Workshop" property-ref="Manager"/>
    <one-to-one name="ManagesTeam" class="Team" property-ref="Manager"/>
  </class>
</hibernate-mapping>